package com.wxy.service;

import java.util.List;

import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;

import com.example.model.user;


public class jdbcImpl {
	private JdbcTemplate jdbcTemplate;
	public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}
	public List<user> findAll(){
		String sqlString="select * from user";
		RowMapper<user> rowMapper=new BeanPropertyRowMapper<user>(user.class);
		return jdbcTemplate.query(sqlString,rowMapper);
	}
}
